package com.e3.template.model;

import java.io.Serializable;
import java.util.List;

import com.extjs.gxt.ui.client.widget.form.Field;

public class TGFFormModel implements Serializable,Comparable<TGFFormModel>{
	
	private static final long serialVersionUID = 5378024506029537534L;

	private int code;
	
	private String name;
	
	private List<Field<?>> fields;
	
	public TGFFormModel(int code,String name,List<Field<?>> fields){
		setCode(code);
		setName(name);
		setFields(fields);
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<Field<?>> getFields() {
		return fields;
	}

	public void setFields(List<Field<?>> fields) {
		this.fields = fields;
	}

	public boolean equals(Object obj){
		if(obj == this){
			return true;
		}
		if(!(obj instanceof TGFFormModel)){
			return false;
		}
		
		TGFFormModel group = (TGFFormModel)obj;
		return getCode()==group.getCode();
	}

	public int compareTo(TGFFormModel o) {
		return getCode()-o.getCode();
	}

}
